# -*- coding: utf-8 -*-
"""
创建日期: 2024/9/17   11:25

@author: justinc
@blog: https://blog.csdn.net/sjc122333?type=blog
@gitee: https://gitee.com/justinc666

"""

# 写入文本文件，覆盖写入
# file_txt = open("./示例文件/作者.txt", mode="wb")
# file_txt.write("justinc".encode("utf-8"))
# file_txt.close()

# file_txt = open("./示例文件/作者_.txt", mode="wt")
# file_txt.write("justinc_")  # 使用默认编码模式utf-8
# file_txt.close()

# 写入文本文件，追加写入
file_txt = open("./示例文件/作者.txt", mode="ab")
file_txt.write("123".encode("utf-8"))
file_txt.close()

# f1 = open("./示例文件/人物.jpg", mode="rb")
# content = f1.read()
# f1.close()
#
# f2 = open("./示例文件/人物_.jpg", mode="wb")
# f2.write(content)
# f2.close()
